package com.beta.cat.exception;

import java.io.Serializable;

/**
 * 业务异常
 */
public class BusinessException extends RuntimeException implements Serializable {

    // 默认错误码是500，防止系统出现未知的异常
    private int code = 500;

    // 错误信息
    private String msg = "系统出了故障，请稍后再试！";

    public BusinessException() {
    }

    public BusinessException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(int code, String msg, Throwable cause) {
        super(msg, cause);
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
